using System;
using System.ComponentModel;
using System.Transactions;

using SIS.ENT;
using SIS.DAL;


/// <summary>
/// The EmployeeOtherSkillsTableManager class is responsible for managing BO.EmployeeOtherSkillsTable objects in the system.
/// </summary>
[DataObjectAttribute()]
public class EmployeeOtherSkillsTableManager
  {

#region "Public Methods"

/// <summary>
/// Gets a list with all EmployeeOtherSkillsTable objects in the database.
/// </summary>
/// <returns>A list with all EmployeeOtherSkillsTable from the database when the database contains any, or null otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Select, true)]
public static EmployeeOtherSkillsTableList GetList(){
return EmployeeOtherSkillsTableDB.GetList();
}
[DataObjectMethod(DataObjectMethodType.Select, true)]
public static EmployeeOtherSkillsTableList GetList(int UserAccountKey)
{
    return EmployeeOtherSkillsTableDB.GetListByUserAccountKey(UserAccountKey);
}
     

/// <summary>
/// Gets a single EmployeeOtherSkillsTable from the database without its data.
/// </summary>
/// <param name="employeeOtherSkillsKey">The EmployeeOtherSkillsKey of the EmployeeOtherSkillsTable in the database.</param>
/// <returns>A EmployeeOtherSkillsTable object when the EmployeeOtherSkillsKey exists in the database, or <see langword="null"/> otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static EmployeeOtherSkillsTable GetItem(int employeeOtherSkillsKey){
return GetItem(employeeOtherSkillsKey, false);
}

/// <summary>
/// Gets a single EmployeeOtherSkillsTable from the database.
/// </summary>
/// <param name="employeeOtherSkillsKey">The EmployeeOtherSkillsKey of the EmployeeOtherSkillsTable in the database.</param>
/// <param name="getEmployeeOtherSkillsTableRecords">Determines whether to load all associated EmployeeOtherSkillsTable records as well.</param>
/// <returns>
/// A EmployeeOtherSkillsTable object when the EmployeeOtherSkillsKey exists in the database, or <see langword="null"/> otherwise.
/// </returns>
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static EmployeeOtherSkillsTable GetItem(int employeeOtherSkillsKey, bool getEmployeeOtherSkillsTableRecords){
EmployeeOtherSkillsTable myEmployeeOtherSkillsTable = EmployeeOtherSkillsTableDB.GetItem(employeeOtherSkillsKey);
return myEmployeeOtherSkillsTable;
}

/// <summary>
/// Saves a EmployeeOtherSkillsTable in the database.
/// </summary>
/// <param name="myEmployeeOtherSkillsTable">The EmployeeOtherSkillsTable instance to save.</param>
/// <returns>The new EmployeeOtherSkillsKey if the EmployeeOtherSkillsTable is new in the database or the existing EmployeeOtherSkillsKey when an item was updated.</returns>
[DataObjectMethod(DataObjectMethodType.Update, true)]
public static int Save(EmployeeOtherSkillsTable myEmployeeOtherSkillsTable){
using (TransactionScope myTransactionScope = new TransactionScope()){
int employeeOtherSkillsTableEmployeeOtherSkillsKey = EmployeeOtherSkillsTableDB.Save(myEmployeeOtherSkillsTable);

//  Assign the EmployeeOtherSkillsTable its new (or existing EmployeeOtherSkillsKey).
myEmployeeOtherSkillsTable.EmployeeOtherSkillsKey = employeeOtherSkillsTableEmployeeOtherSkillsKey;

myTransactionScope.Complete();

return employeeOtherSkillsTableEmployeeOtherSkillsKey;
}
}

/// <summary>
/// Deletes a EmployeeOtherSkillsTable from the database.
/// </summary>
/// <param name="myEmployeeOtherSkillsTable">The EmployeeOtherSkillsTable instance to delete.</param>
/// <returns>Returns true when the object was deleted successfully, or false otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Delete, true)]
public static bool Delete(EmployeeOtherSkillsTable myEmployeeOtherSkillsTable){
return EmployeeOtherSkillsTableDB.Delete(myEmployeeOtherSkillsTable.EmployeeOtherSkillsKey);
}

[DataObjectMethod(DataObjectMethodType.Delete, true)]
public static bool Delete(int EmployeeOtherSkillsKey)
{
    return EmployeeOtherSkillsTableDB.Delete(EmployeeOtherSkillsKey);
}

#endregion

}

